package com.pfzy.ui.activity.learning;

import android.os.Bundle;
import android.view.View;
import android.widget.TextView;

import androidx.appcompat.app.AppCompatActivity;
import androidx.recyclerview.widget.LinearLayoutManager;
import androidx.recyclerview.widget.RecyclerView;

import com.pfzy.ui.R;
import com.pfzy.ui.databinding.ActivityLearningBinding;

import java.util.ArrayList;
import java.util.List;

public class LearingActivity extends AppCompatActivity implements View.OnClickListener {
    private ActivityLearningBinding mBind;
//    private LearningAdapter adapter;

    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        mBind = ActivityLearningBinding.inflate(getLayoutInflater());
        setContentView(mBind.getRoot());
        initView();
    }

    private void initView() {
        TextView title = mBind.toolbar.findViewById(R.id.layout_toolbar_title);
        title.setText("吐司");
        mBind.toolbar.findViewById(R.id.layout_toolbar_back).setOnClickListener(this);

//        mBind.recycler.setLayoutManager(new LinearLayoutManager(this, RecyclerView.VERTICAL, false));
//        mBind.recycler.setAdapter(adapter = new LearningAdapter());
//        adapter.setData(generateLearningParams());
//        adapter.notifyDataSetChanged();
    }

    private List<LearningParam> generateLearningParams() {
        List<LearningParam> learningParams = new ArrayList<>();
        for (int i = 0; i < 10; i++) {
            learningParams.add(new LearningParam("阿弥陀佛 " + i + 1, "我是一个详细的描述，很详细"));
        }
        return learningParams;
    }

    @Override
    public void onClick(View v) {
        switch (v.getId()) {
            case R.id.layout_toolbar_back:
                finish();
                break;
            default:
                break;
        }
    }
}
